import Ajax from "../../../utlis/Ajax.js";
// import Ajax from "../";
export default class Header {
  constructor() {
    this.head = document.querySelector("head");
    this.header = document.querySelector("header");
  }
  init() {
    this.render();
  }
  render() {
    this.renderHtml();
    this.renderStyle();
  }
  renderHtml() {
    Ajax.load(`../views/header/index.html`, "header", (templet) => {
      // console.log(templet);
      this.header.innerHTML = templet;
    });
  }
  renderStyle() {
    Ajax.get(`../views/header/css/style.css`, (res) => {
      let style = document.createElement("style");
      style.innerHTML = res;
      this.head.appendChild(style);
    });
  }
}
